package com.dayaokeji.rhythmschoolstudent.client.mine.statistics.adapter

import android.graphics.Color
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.dayaokeji.rhythmschoolstudent.R
import com.dayaokeji.rhythmschoolstudent.client.common.exam.subject_type.utils.ScoreUtil
import com.dayaokeji.rhythmschoolstudent.utils.SignUtils
import com.dayaokeji.server_api.domain.StatisticDetail

/**
 *********************************************************************
 **  Created by Zeno on 2018/7/26
 *********************************************************************
 **  version 1.0
 *********************************************************************
 **  Copyright (C) dayaokeji.com 2018 -- 2020 All rights reserved.
 *********************************************************************
 ** 考勤详情adapter
 *********************************************************************
 */
class StatisticDetailAdapter : BaseQuickAdapter<StatisticDetail,BaseViewHolder>(R.layout.item_statistics_detail,null) {

    override fun convert(helper: BaseViewHolder?, item: StatisticDetail?) {
        helper?.setText(R.id.tv_course_name,item?.courseName)
        helper?.setText(R.id.tv_course_time,item?.actStartTime)
        helper?.setText(R.id.tv_online_time,ScoreUtil.doubleTrans(item?.onlineTime!!)+"分钟");
        helper?.setText(R.id.tv_exist_amount,mContext.getString(R.string.ci_str,item?.existAmount))
        helper?.setText(R.id.tv_answer_amount,mContext.getString(R.string.ci_str,item?.answerAmount))
        helper?.setText(R.id.tv_call_success,mContext.getString(R.string.ci_str,item?.callSuccAmount))
        val textView = helper?.getView<TextView>(R.id.tv_sign_status)
        textView?.text = SignUtils.getSignStatus(item?.signStatus!!)
    }
}